
class InvKhi2 : public Distribution
{
	public:
	InvKhi2(){}
	InvKhi2(int n,int nu)
	{
		_nu=nu;
		_n=n;
		boost::random::gamma_distribution<> N(_nu/2,2);
		dn= new boost::math::gamma_distribution<>(_nu/2,2); 
		rgamma= new RandomG::Random<boost::random::gamma_distribution<> >(N);
	}
	virtual ~InvKhi2()
	{
		delete rgamma;
		delete dn;
	}

	mat r(int j)
	{
		mat X(_n,1);
		for(int i=0;i<_n;i++)
		{
		 	X(i,0)=1/((*rgamma)());
		}
		return X;
	}


	double 	d(mat x,int b=0,int kk=0){
	
	return 0;	
	}
	mat scrambled(int M)
	{
		mat U(1,1);	
		cout << "no scrambled sequence for InvKhi";
		return U;
	}
	mat Var(mat X){return arma::cov(X);}
	void Set_n(int n){	_n=n;	}
	void Set_m(mat m){	_m=m;	}
	void Set_s(mat s){}
	mat Get_s(void){return _s;}
	mat Get_m(void){mat o(1,1);o(0,0)=_nu;return o;}
	private:
	int _n;
	int _nu;
	mat _m;
	mat _s;
	mat _is;
	mat _cs;
	RandomG::Random<boost::random::gamma_distribution<> > *rgamma;
	boost::math::gamma_distribution<> *dn;

};
